enum UserAPIScope {
  mapGateway, gateway
}

class UserAPIResponsitory {


  static const _MAP_GATE_WAY = "bmwgatewayserviceint.chinacloudsites.cn";
  static const _GATE_WAY = "bmwgatewayserviceint.chinacloudsites.cn:443";
  static const _SCHEME = "https";

  final UserAPIScope scope;

  UserAPIResponsitory({this.scope});

  final String domain = "bmwgatewayserviceint.chinacloudsites.cn";

  Map<String, String> _headers = {
    "Authorization": "Bearer ${_authentication}"
  };
  //  "Content-Type": "application/x-www-form-urlencoded"

  Map<String, String> getHeaders() {
    return _headers;
  }

  String getHost() {
    switch (scope) {
      case UserAPIScope.mapGateway:
        return _MAP_GATE_WAY;
      case UserAPIScope.gateway:
        return _GATE_WAY;
    }
  }

  String getScheme() {
    return _SCHEME;
  }

  String constructServerAddress(String path){
    var scheme = getScheme();
    var host = getHost();
    return "${scheme}://${host}${path}";
  }

  //Temp for debug
  static const _authentication =  "oMPlM648NAc1w2kLnnekD7QalcMHzLwBbPXzqY6dkSieV0R5CCiLlmCpXwvq9cTw0n9AodSZs7yGQyAL66qYASCTfmsYnw-6Cefy9acGjeJTdNP96KjHomiVoSjcFMu5Q1Zz0E_Sm2s0yn3vfzmbQ7Ze_e_RzDxDYLkELFLzbR_8T57gktW48ox2y5tYo1MNYXBsFz79YY2ILlEEzjUWSgYJ6gGk3hsdWZAYbDl1sckVFQA4lTSsF72KJYFbbXEqhLjbzZAf6BHJC99WBTU1NIybySKd0adZjW2T8hNt5cfYqJVDChK0XJY9IzPVNx3kA3LCG-pIz-A-du3YDnN3RVdtuPDKtZ8rSa39F5WlHdSShksFI0n2SoHq2wjoEhr1UgBUb7ZCk1O6VyCMFDwTcVL-usjnQIf2kCAXgsZblwtUWWGmYcqAGiDCEeV4gNYbwFgu5wZhGa34XnL6_IaV3_vnPp0LVsuACWUnT0gdxLe6S03rd8r21FOra0m6D1_ycvSvB5dQ6Cb5LpTtKahOqI9fH1iOaX9gv87rvgx49qXnVi3MWlX_4trY8qqOgITFSAu3twLw_ZjGWpRuC_3sFHH8TVIkyFB7-toUG1iJUfA6Ys3mV6ufXw0muacaJ0yC";

}